<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>{$title}</title>
    <link href="{$Think.config.RESOURCEURL}wx_assets/css/common.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="{$Think.config.RESOURCEURL}wx_assets/enroll/css/index.css" />
    <script type="text/javascript">
    var baseUrl = '{$Think.config.SERVER_HOST}';
    var userName = '{$userName}';
    </script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.min.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.alert.js{$Think.config.RESOURCE_VER}"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/js/util.js" type="text/javascript" charset="utf-8"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/moments/js/wx_share_angular.js{$Think.config.RESOURCE_VER}" type="text/javascript" charset="utf-8"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/enroll/js/remApp.js" type="text/javascript" charset="utf-8"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/enroll/js/layer.m.js" type="text/javascript" charset="utf-8"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/enroll/js/arttemplate.js" type="text/javascript" charset="utf-8"></script>
    <style>
        body
        {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }
        .container
        {
           position: relative;
           width: 100%;
           height: 100%;
           overflow-y: auto;
           background:url('{$jsonstr.activity_bg.src}') no-repeat;
           background-size: cover;
           -webkit-overflow-scrolling : touch;
        }
    </style>
</head>

<body>
		<input type="hidden" id="fee" value={$jsonstr.money}>
		<input type="hidden" id="activityname" value={$jsonstr.activityname}>
		<input type="hidden" id="actId" value={$id}>
    <input type="hidden" id="is_send_location" value="{$jsonstr.is_send_location}">
    <input type="hidden" id="customerId" value="{$customerId}">
    <div class="container">
        <div class="banner">
            <img src="{$jsonstr.activity_main.src}@640w_320h_1c_1e" />
        </div>
        <div class="class-info">
            <p>{$jsonstr.activityname}</p>
            <p>报名时间：{$startTime|date="m月d日 H:i:s",###}-{$endTime|date="m月d日 H:i:s",###}</p>
            <p>
                {$activity_status}
            </p>
        </div>
        <ul class="activeinfo">
            <li>
                <i class="iconfont">&#xe600;</i>{$jsonstr.actPlace}
            </li>
            <li>
                <i class="iconfont">&#xe603;</i>{$jsonstr.startTime|date="m月d日 H:i:s",###}-{$jsonstr.endTime|date="m月d日 H:i:s",###}
            </li>
            <if condition="$jsonstr.isPay eq '1'">
                <li>
                    <i class="iconfont">&#xe6fb;</i>报名费:{$jsonstr.money}元
                </li>
            </if>
        </ul>
        <div class="btn">
            <a class="submit preSubmit">
                <img src="{$jsonstr.activty_index_button.src}" alt="">
            </a>
        </div>
        <div class="tips" id="activity_index_img">
        </div>

    </div>
    
     <div class="sharebg"><img src="{$Think.config.RESOURCEURL}wx_assets/enroll/img/share.png"></div>
</body>
<script type="text/html" id="activity_index_img_tpl">
    {{each data as value}}
    <img src="{{value}}" alt=""> 
    {{/each}}
</script>
<script type="text/javascript">
var entryFormArray = <?php echo json_encode($jsonstr); ?>
</script>
<script type="text/html" id="entryForm">
    <form id="_entryForm">
        <div class="closebtn"><i class="iconfont">&#xe611;</i></div>
        <ul class="layertime">
            {{each $data as item}}
            <li>
                <span>{{item.itemName}}</span> {{if item.itemType[0] == '1'}}
                <input value="{{item.itemDef}}" type="text" data-info="{{item.itemInfo}}" data-need="{{item.isNeed}}" placeholder="{{item.itemInfo}}" formjson itemName="{{item.itemName}}" itemType="{{item.itemType[0]}}"> {{/if}} {{if item.itemType[0] == '2'}}
                <select name="" data-info="{{item.itemInfo}}" data-need="{{item.isNeed}}" id="" formjson itemName="{{item.itemName}}" itemType="{{item.itemType[0]}}">
                    {{each item.itemType[1] as key i}}
                    <option value="{{key}}">{{key}}</option>
                    {{/each}}
                </select>
                {{/if}} {{if item.itemType[0] == '3'}}
                <input type="date" data-info="{{item.itemInfo}}" data-need="{{item.isNeed}}" formjson itemName="{{item.itemName}}" itemType="{{item.itemType[0]}}"> {{/if}} {{if item.itemType[0] == '4'}}
                <div class="upload" data-info="{{item.itemInfo}}" data-need="{{item.isNeed}}" formjson data-value="" itemName="{{item.itemName}}" itemType="{{item.itemType[0]}}">
                    <i>+</i>
                </div>
                {{/if}}
            </li>
            {{/each}}
        </ul>
        <input name="hidden" type="text" style="display:none;">
        <a class="submit submitform">
            <img src="{$jsonstr.activity_submit_button.src}" alt="">
        </a>
    </form>

</script>
<script type="text/html" id="need_subscribe">
    <div class="closebtn"><i class="iconfont">&#xe611;</i></div>
    <div class="layerinfo">
        <img src="{$jsonstr.activity_join_main.src}" alt="">
    </div>
</script>
<script type="text/html" id="successForm">
    <div class="closebtn"><i class="iconfont">&#xe611;</i></div>
    <div class="layerinfo">
        <img src="{$jsonstr.activity_info_bg.src}" alt="">
    </div>
    <a class="sharebtn" style="height:auto;">
        <img src="{$jsonstr.activity_info_submit.src}" alt="">
    </a>
</script>
<script src="{$Think.config.RESOURCEURL}wx_assets/enroll/js/index.js{$Think.config.RESOURCE_VER}" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    var shareLink= buildUrl("html", "enroll", "index", {
            actId: $.util.getParamByObject("actId"),
            chanelId:$.util.getParamByObject("chanelId"),
            fromUserId:$.util.getParamByObject("fromUserId")?$.util.getParamByObject("fromUserId"):"{$userId}"
    })
    var shareData = {
        "title": "{$title}",
        "desc": "{$description}",
        "link": baseUrl+shareLink,
        "imgUrl": "{$picurl}",
        "pkg": {
            "appId": '{$pkg.appId}',
            "timestamp": {$pkg['timestamp']?$pkg['timestamp']:'""'},
            "nonceStr": '{$pkg.nonceStr}',
            "signature": '{$pkg.signature}'
        }
    }
    $(function(){
        wx_share.init(shareData);
    })
</script>
<script type="text/javascript">
    function loadImage(url,callback) {       
        var img =new Image();  
        img.onload =function(){  
            img.onload =null;  
            callback(img);  
        }  
        img.src = url;   
    } 
    var url=$(".banner img").attr("src");
    loadImage(url,function(img){
        var height=$(".banner img").height();
        // $(".container").css({
        //     "background-position":"50% "+height+"px"
        // });
    });
</script>
</html>

